$(function(){
    var id = $('#goodsextra-group_id').val();
    $.post(package_url, {id:id}, function(data){
        if(data.success == true){
            var result = data.data;
            $('#goodsextra-package_id').html('');
            for(var i=0;i<result.length;i++){
                $('#goodsextra-package_id').append('<option value="'+ result[i].package_id +'">'+ result[i].package_name +'</option>')
            }
        }
    }, 'json')
    $('#goodsextra-group_id').change(function(){
        var id = $(this).val();
        $.post(package_url, {id:id}, function(data){
            if(data.success == true){
                var result = data.data;
                $('#goodsextra-package_id').html('');
                for(var i=0;i<result.length;i++){
                    $('#goodsextra-package_id').append('<option value="'+ result[i].package_id +'">'+ result[i].package_name +'</option>')
                }
            }
        }, 'json')
    });
})